﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace Chisholm.Windows.Live.Library
{
    /// <summary>
    /// This interface describes the methods supported by the Windows Live Single Sign On (SSO) Server
    /// </summary>
    [ServiceContract]
    public interface ISSOServerEngine
    {
        /// <summary>
        /// This method authenticates the given Windows Live ID against the source server and returns
        /// the Short Lived Token (or an empty string if the user couldn't be authenticated)
        /// </summary>
        /// <param name="windowsliveid">The windows live ID of the user to authenticate</param>
        /// <returns>Either the issued Short Lived Token, or an empty string if an error occurred</returns>
        [OperationContract]
        string GetSLT(string windowsliveid);

        /// <summary>
        /// This method authenticates the given Windows Live ID against the source server and then, 
        /// depending on the desired service chosen, returns the redirection URL to that service with
        /// the short lived token and Windows Live ID embedded
        /// </summary>
        /// <param name="windowsliveid">The Windows Live ID of the user to authenticate</param>
        /// <param name="desiredservice">The desired service to access</param>
        /// <returns>The pre-prepared URL ready for redirection</returns>
        [OperationContract]
        string GetRedirectionURL(string windowsliveid, LiveServiceTypes desiredservice);
    }
}
